<template>
  <div class="groupshop">
    <div class="groupshop_top">
      <div class="groupshop_top_left">
        <img src="../../../../public/left1.jpg" alt="" @click="handleClick()" />
      </div>
      <div class="groupshop_top_title">商品详情</div>
    </div>
    <div class="groupshop_conter">
      <img :src="this.list.img" alt="" class="groupshop_conter_img" />
      <div class="groupshop_conter_price">
        <div class="groupshop_conter_price_left">
          ￥{{ this.list.discountprice }}
        </div>
        <div class="groupshop_conter_price_right">￥{{ this.list.price }}</div>
      </div>
      <div class="groupshop_conter_titlebox">
        <div class="groupshop_conter_title">
          {{ this.list.title }}
        </div>
        <div class="groupshop_conter_type">
          <div>类型：{{ this.list.joinnum + this.list.residuenum }}人团</div>
          <div>累计销量：{{ this.list.totalsell }}</div>
          <div>限购：{{ this.list.limited }}</div>
        </div>
        <div class="groupshop_conter_play">
          <div>拼团玩法</div>
        </div>
        <div class="groupshop_conter_playexplain">
          <img
            src="../../../../public/explain.png"
            alt=""
            class="groupshop_conter_playexplain_img"
          />
        </div>
        <div class="groupshop_conter_comment">
          <div>用户评价（{{ this.list.comment.length }}）</div>
        </div>
      </div>
      <div class="groupshop_bottom_introduce">
        <div class="groupshop_bottom_introduce_title">产品介绍</div>
        <div class="groupshop_bottom_introduce_imgbox">
          <div v-for="(item, index) in list.children" :key="index">
            <img
              :src="item.img"
              alt=""
              class="groupshop_bottom_introduce_img"
            />
          </div>
        </div>
      </div>
      <div class="groupshop_bottom_box">
        <div class="groupshop_bottom_buy" @click="handleBuy()">单独购买</div>
        <div class="groupshop_bottom_group" @click="handleGroup()">
          立即拼团
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  created() {
    console.log(this.$route.query.v.comment.length);
    this.list = this.$route.query.v;
  },
  data() {
    return {
      list: [],
    };
  },
  methods: {
    handleClick() {
      this.$router.go(-1);
    },
    handleBuy() {
      this.$router.push({ path: "/paymentfront" });
    },
    handleGroup() {
      this.$router.push({ path: "/WriteAddress" });
    },
  },
};
</script>

<style lang="scss" scoped>
.groupshop {
  width: 100%;
  height: 100%;
}
.groupshop_top {
  width: 100%;
  height: 50px;
  position: relative;
  line-height: 50px;
}
.groupshop_top_left {
  width: 50px;
  height: 50px;
  text-align: center;
  line-height: 50px;
}
.groupshop_top_title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.groupshop_conter {
  width: 100%;
  height: 100%;
}
.groupshop_conter_img {
  width: 100%;
  height: 300px;
}
.groupshop_conter_price {
  width: 100%;
  height: 50px;
  display: flex;
}
.groupshop_conter_price_left {
  // width: 100px;
  margin-left: 20px;
  height: 50px;
  line-height: 50px;
  text-align: center;
  font-size: 24px;
  color: red;
  font-weight: bold;
}
.groupshop_conter_price_right {
  width: 50px;
  height: 50px;
  line-height: 60px;
  font-size: 14px;
  color: #ccc;
  text-decoration: line-through;
  margin-left: 5px;
}
.groupshop_conter_titlebox {
  width: 100%;
  height: 240px;
}
.groupshop_conter_title {
  width: 95%;
  height: 70px;
  margin-left: 2.5%;
}
.groupshop_conter_type {
  width: 100%;
  height: 30px;
  border-bottom: 1px solid #ccc;
  display: flex;
  justify-content: space-between;
}
.groupshop_conter_type > div {
  margin-left: 15px;
  margin-right: 15px;
}
.groupshop_conter_play {
  width: 100%;
  height: 40px;
  border-bottom: 1px solid #ccc;
  display: flex;
  justify-content: space-between;
}
.groupshop_conter_play > div {
  width: 100px;
  height: 40px;
  line-height: 40px;
  margin-left: 15px;
  margin-right: 15px;
}
.groupshop_conter_playexplain_img {
  width: 100%;
  height: 60px;
}
.groupshop_conter_comment {
  width: 100%;
  height: 30px;
  border-bottom: 1px solid #ccc;
  display: flex;
  justify-content: space-between;
}
.groupshop_conter_comment > div {
  margin-left: 15px;
}
.groupshop_bottom_introduce {
  width: 100%;
}
.groupshop_bottom_introduce_title {
  width: 100%;
  height: 50px;
  line-height: 50px;
  text-align: center;
  font-size: 22px;
}
.groupshop_bottom_introduce_imgbox {
  width: 100%;
  margin-bottom: 20px;
}
.groupshop_bottom_introduce_img {
  width: 100%;
  height: 400px;
}
.groupshop_bottom_box {
  width: 100%;
  height: 50px;
  display: flex;
}
.groupshop_bottom_buy {
  width: 50%;
  height: 50px;
  text-align: center;
  line-height: 50px;
  color: #fff;
  background: #ff9900;
}
.groupshop_bottom_group {
  width: 50%;
  height: 50px;
  text-align: center;
  line-height: 50px;
  color: #fff;
  background: #ff6600;
}
</style>